package com.shundr.shipper.frame.http;

/**
 * 
 * HttpResult 网络请求返回数据结构
 * 
 * @author larry 2015-4-10 下午3:19:18
 * @version 1.0.0
 *
 */
public class HttpResult {

	public static final String RESPONSE = "response";
	public static final String RESULT = "result";
	public static final String PARAMS = "params";
	public static final String STATUS = "status";
	public static final String QUERYMETHOD = "queryMethod";
	public static final String DESCRIPTION = "description";
	public static final String NUMRETURN = "numReturn";
	public static final String CODE = "code";

	// 非业务逻辑错误码应该小于0，成功为0，系统业务逻辑错误码大于0
	public static final int RESULT_CODE_SUCCESS = 0;// 请求成功
	public static final int RESULT_CODE_SERVER_EXCEPTION = -1;// 服务器异常
	public static final int RESULT_CODE_UNKNOW_EXCEPTION = -2;// 解析返回值的异常
	public static final int RESULT_CODE_CONNECTION_EXCEPTION = -999;// 网络异常

	public static final String RESULT_CODE_SERVER_EXCEPTION_VALUE = "服务器返回值异常";// 服务器异常描述
	public static final String RESULT_CODE_UNKNOW_EXCEPTION_VALUE = "解析返回值时发生异常";// 解析返回值的异常描述
	public static final String RESULT_CODE_CONNECTION_EXCEPTION_VALUE = "连接不到服务器或发生网络异常，请检查网络设置或重试";// 网络异常描述

	private String result;
	private String params;
	private String status;
	private String queryMethod;
	private String description;
	private int numReturn;
	private int code;

	private boolean requestSuccessed;// 判断请求是否成功

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getQueryMethod() {
		return queryMethod;
	}

	public void setQueryMethod(String queryMethod) {
		this.queryMethod = queryMethod;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getNumReturn() {
		return numReturn;
	}

	public void setNumReturn(int numReturn) {
		this.numReturn = numReturn;
	}

	public boolean isRequestSuccessed() {
		return requestSuccessed;
	}

	public void setRequestSuccessed(boolean requestSuccessed) {
		this.requestSuccessed = requestSuccessed;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

}
